<?php
class Controller extends CController
{
	/**
	 * @var ClientScript
	 */
	public $cs;

	public function init()
	{
		$this->cs = Yii::app()->clientScript;
		$this->cs->registerScriptFile('/js/lib/main.js');
	}

	public function isPostRequest()
    {
        return Yii::app()->getRequest()->isPostRequest;
    }

    public function isAjaxRequest()
    {
        return Yii::app()->getRequest()->isAjaxRequest;
    }

	public function issetAjaxParam()
	{
		return isset($_POST['ajax']);
	}

    public function getParam($key, $defaultValue = null, $useAnchor = false)
    {
        return Yii::app()->getRequest()->getParam($key, $defaultValue, $useAnchor);
    }
}
